package cn.rgb.orm;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import javax.sql.DataSource;

public interface SqlExecutor {

	public void setDataSource(DataSource ds);
	
	public Object insert(String sqlId) throws SQLException;
	
	public Object insert(String sqlId, Object params) throws SQLException;
	
	public Object delete(String sqlId) throws SQLException;
	
	public Object delete(String sqlId, Object params) throws SQLException;
	
	public Object update(String sqlId) throws SQLException;
	
	public Object update(String sqlId, Object params) throws SQLException;
	
	public Object queryForObject(String sqlId) throws SQLException;
	
	public Object queryForObject(String sqlId, Object params) throws SQLException;
	
	public List<Object> queryForList(String sqlId) throws SQLException;
	
	public List<Object> queryForList(String sqlId, Object params) throws SQLException;
	
	public Connection getConnection() throws SQLException;
	
	public Connection getCurrentConnection() throws SQLException;
	
	public void startTransaction() throws SQLException;
	
	public void commitTransaction() throws SQLException;
	
	public void rollbackTransaction() throws SQLException;
}
